<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layouts/layout}">
<!-- BEGIN HEAD -->
<head>
    <title>消息供应商编辑</title>
    <link rel="stylesheet" type="text/css" href="/assets/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css" />
    <link rel="stylesheet" type="text/css" href="/assets/plugins/bootstrap-timepicker/compiled/timepicker.css" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<th:block layout:fragment="content">
    <!-- BEGIN PAGE CONTAINER-->
    <div class="container-fluid">
        <!-- BEGIN PAGE HEADER-->
        <div class="row-fluid">
            <div class="span12">
                <!-- BEGIN SAMPLE FORM PORTLET-->
                <div class="portlet ">
                    <div class="portlet-body form">
                        <div th:class="${error != null ? 'alert alert-error' : 'alert alert-error hide'}">
                            <button class="close" data-dismiss="alert"></button>
                            <span th:text="${error}"></span>
                        </div>
                        <div class="row-fluid">
                            <form action="#" id="tform" class="form-horizontal" >
                                <input type="hidden" id="id" name="id" th:field="*{supplier.id}">
                                <!--<input type="hidden" id="supplierType" name="supplierType" th:field="*{supplier.supplierType}">-->
                                <input type="hidden" id="sysVersion" name="sysVersion" th:field="*{supplier.sysVersion}">
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>类型：</label>
                                    <div class="controls">
                                        <select class="small m-wrap" id="type" name="type" th:field="*{supplier.type}" onchange="changeFunction()">
                                            <option value="1">短信</option>
                                            <option value="2">邮件</option>
                                            <option value="3">推送</option>
                                        </select>
                                        <span class="help-inline msg-box"></span>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>供应商类型：</label>
                                    <div class="controls">
                                        <select class="small m-wrap" id="supplierType" name="supplierType" th:field="*{supplier.supplierType}">
                                            <option value="11">11</option>
                                            <option value="21">21</option>
                                            <option value="31">31</option>
                                        </select>
                                        <span class="help-inline msg-box"></span>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>供应商名称：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{supplier.name}" id="name" name="name" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>每天次数限制：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{supplier.timesLimitPerDay}" id="timesLimitPerDay" name="timesLimitPerDay" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>外部appId：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{supplier.outerAppKey}" id="outerAppKey" name="outerAppKey" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>外部系统密钥：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{supplier.outerSecret}" id="outerSecret" name="outerSecret" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>请求Url：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{fields.url}" id="url" name="url" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>发送源名称：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{fields.sourceName}" id="sourceName" name="sourceName" class="large m-wrap"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="required">*</span>发送服务器：</label>
                                    <div class="controls">
                                        <input type="text" placeholder="" th:field="*{fields.sourceServer}" id="sourceServer" name="sourceServer" class="large m-wrap"/>
                                    </div>
                                </div>

                                <div class="form-actions">
                                    <button type="button" onclick="update()" class="btn blue">保存</button>
                                    <a type="button" th:href="@{javascript:history.go(-1);}" class="btn">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- END SAMPLE FORM PORTLET-->
            </div>
        </div>
        <!-- END PAGE CONTENT-->
    </div>
</th:block>
<th:block layout:fragment="content-js">
    <script type="text/javascript" th:src="@{/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js}"></script>
    <script type="text/javascript" th:src="@{/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{/assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js}"></script>
    <script type="text/javascript" th:src="@{/assets/js/supplier.js}"></script>
</th:block>
</body>
<!-- END BODY -->
</html>